package iphoneBackupScanner.gui;

import java.awt.BorderLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import javax.naming.InitialContext;
import javax.swing.JFrame;
import javax.swing.JProgressBar;

public class ProgressWindow extends JFrame{

	public final JProgressBar progress;

	public ProgressWindow(int maxFiles) {

		super();

		progress = new JProgressBar(0, maxFiles);
		initWindow();

		progress.setString("Copying");
		progress.setStringPainted(true);
		
		super.pack();

		super.setVisible(true);
	}

	private void initWindow() {
		super.setResizable(false);
		super.setLayout(new BorderLayout());
		super.getContentPane().add(progress);
		super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	public void incrementProgress() {
		
		
		progress.setValue(progress.getValue()+1);
		
		if(progress.getValue() == progress.getMaximum())
			progress.setString("Finish");
	}

	

}
